import 'package:wanxiang_app/generated/json/base/json_convert_content.dart';
import 'package:wanxiang_app/bean/simple_entity.dart';

SimpleEntity $SimpleEntityFromJson(Map<String, dynamic> json) {
  final SimpleEntity simpleEntity = SimpleEntity();
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    simpleEntity.code = code;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    simpleEntity.status = status;
  }

  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    simpleEntity.msg = msg;
  }
  final String? data = jsonConvert.convert<String>(json['data']);
  if (data != null) {
    simpleEntity.data = data;
  }
  return simpleEntity;
}

Map<String, dynamic> $SimpleEntityToJson(SimpleEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['code'] = entity.code;
  data['status'] = entity.status;
  data['msg'] = entity.msg;
  data['data'] = entity.data;
  return data;
}

extension SimpleEntityExtension on SimpleEntity {
  SimpleEntity copyWith({
    int? code,
    int? status,
    String? msg,
    String? data,
  }) {
    return SimpleEntity()
      ..status = code ?? this.status
      ..code = code ?? this.code
      ..msg = msg ?? this.msg
      ..data = data ?? this.data;
  }
}